package com.kgc.study;

public class Penguin extends  Pet {
    /**
     * 特有的属性  性别
     */
    private String gender;

    public Penguin() {

    }

    public Penguin(String name, int health, int love, String gender) {
        super(name, health, love);



        this.gender = gender;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    //重写方法(将父类的方法重新实现)
    @Override
    public void print() {
        System.out.println("企鹅说:");
        System.out.println("我的名字叫" + super.getName() + ",我的健康的值：" + super.getHealth() + ",我和主人亲密度是:" + super.getLove() +",我的性别是:" + this.getGender());
    }


    @Override
    public void toHospital() {
        if(this.getHealth() <  50){
            System.out.println(this.getName() + "生病了，正在宠物医看病中...");
            System.out.println("治疗方法是：打针、输液 ...");
            this.setHealth(80);
            System.out.println("正在恢复中，健康值增加了" + this.getHealth());
        }
    }
}
